package com.ccit.service.impl;

import com.ccit.dao.UserDao;
import com.ccit.domain.AttendanceType;
import com.ccit.domain.Time;
import com.ccit.domain.User;
import com.ccit.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.security.util.Password;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;


    public boolean add(User user) {
        return userDao.add(user) > 0;
    }


    @Override
    public List<Time> getTime() {
        return userDao.getTime();
    }
    @Override
    public List<User> selectAll() {
        return userDao.selectAll();
    }

    @Override
    public boolean selectByUsername(String username) {
        return false;
    }

    @Override
    public User login(String username, String password) {
        User user = userDao.select(username, password);
        return user;
    }

    @Override
    public boolean isUsernameTaken(String username) {
        return userDao.selectByUsername(username);
    }


}
